package com.hw.paltfrom.mapper;


import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.hw.paltfrom.pojo.HwDataEnterpriseHistory;
import com.hw.paltfrom.vo.SourceCarsRankListEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface HwDataEnterpriseHistoryMapper extends BaseMapper<HwDataEnterpriseHistory> {

    //源头出场车辆检测排行
    @Select("SELECT top 3 count(*) AS ccclNum,deh.F_AreaCode AS fAreaCode,(SELECT ba.F_AreaName FROM HW_Base_Area AS ba WHERE ba.F_AreaCode=deh.F_AreaCode) AS fAreaName FROM dbo.HW_Data_Enterprise_History AS deh WHERE CONVERT(varchar(20),deh.CCSJ,120) BETWEEN '${startTime}' AND '${endTime}' GROUP BY F_AreaCode ORDER BY ccclNum DESC")
    List<SourceCarsRankListEntity> ytccclRankList(@Param("startTime")String startTime, @Param("endTime")String endTime);
}